Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid using protected members outside scope #1083

Merged
merged 7 commits into from
Nov 11, 2020
Merged

Conversation

hub-cap
Copy link
Contributor

@hub-cap hub-cap commented Oct 8, 2020

With this commit we reenable the pylint check W0212 which checks
whether protected members are used outside of their classes scope.

Relates #838

@hub-cap hub-cap added the cleanup Linter changes, reformatting, removal of unused code etc. label Oct 8, 2020
@hub-cap hub-cap added this to the 2.0.2 milestone Oct 8, 2020
@hub-cap hub-cap requested a review from gingerwizard October 8, 2020 18:44
@hub-cap hub-cap self-assigned this Oct 8, 2020
@hub-cap hub-cap changed the title Fix pylint W0212 Avoid using protected members outside scope Oct 12, 2020
@danielmitterdorfer danielmitterdorfer modified the milestones: 2.0.2, 2.0.3 Oct 26, 2020
Copy link

@gingerwizard gingerwizard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hub-cap you have a conflict here to resolve.

Whilst disabling warnings for tests makes sense, have we checked we can't mitigate some of these by just exposing accessors for the variables?

@hub-cap
Copy link
Contributor Author

hub-cap commented Nov 2, 2020

The way I look at it, since these are almost all tests,. it doesn't make a ton of sense to expose members for them.

Looks like there are a few new things to clean up, im working on them now.

@hub-cap hub-cap requested a review from gingerwizard November 3, 2020 18:08
@gingerwizard
Copy link

@hub-cap see #1106 (review) why this maybe failed. @danielmitterdorfer corrected the reference

Copy link

@gingerwizard gingerwizard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See changes due to #1106

self.template_definitions.append((template.name, body))
else:
raise exceptions.InvalidSyntax("Please set the properties 'template' and 'body' for the "
f"{params.get('operation-type')} operation or declare composable and/or component "
"templates in the track")

@staticmethod
def _create_or_merge(content, path, new_content):
def create_or_merge(self, content, path, new_content):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to do this anymore - See #1106

return original_content

@staticmethod
def __merge(dct, merge_dct):
def merge(self, dct, merge_dct):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above

@hub-cap
Copy link
Contributor Author

hub-cap commented Nov 5, 2020

I reverted the code for that, ty @gingerwizard for the pointer.

@hub-cap hub-cap requested a review from gingerwizard November 5, 2020 15:28
Copy link

@gingerwizard gingerwizard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now we have the other change. You have a conflict but this looks easily fixed.

@hub-cap hub-cap merged commit 430f6aa into elastic:master Nov 11, 2020
@hub-cap hub-cap deleted the lint_W0212 branch November 11, 2020 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Linter changes, reformatting, removal of unused code etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants